#ifndef OPTRZONE_H
#define OPTRZONE_H


class LogEvent;
class Application;
class EventView;

#include <optra/common/logevent.h>
#include <optra/common/guiwindow.h>

using Optra::GuiWindow;

class AlertWindow;
class OptraZone : public Optra::ZoneInterface
{
    Q_OBJECT
    Q_PROPERTY(QStringList availableZones READ availableZones);
    Q_PROPERTY(QString version READ version);
public:
    explicit OptraZone(Application* main, QObject *parent = 0);
    ~OptraZone();


    Q_INVOKABLE GuiWindow* htmlWindow(int width, int height);

    QString version()const;

    void zloaded(const QString& name);
    void go();
protected:
    Optra::ZoneInfo* zoneInfo() { return info_; }
    bool event(QEvent *event);

    void logEvent(Optra::LogEvent* ev);
    QStringList availableZones()const;


    bool configure(bool read);
    bool install();

signals:
    void zoneLoaded(const QString& name);
    void ready();

public slots:
    void activateView(const QString& id);
    AlertWindow* showTimedInformationWindow(QString message, int time);

private:
    Optra::ZoneInfo* info_;
    Application* main_;
    EventView* eventView_;
};


#define O_Z extern OptraZone* _ozone__Z_;
#define OZ (_ozone__Z_)


#endif // OPTRZONE_H
